<?php
class Xigg_Main_Plugin extends Sabai_Controller
{
    function _doExecute(&$context)
    {
        $plugin_mngr =& $this->_locator->getService('PluginManager');
        if (!$plugin =& $plugin_mngr->isPluginInstalled($context->request->getAsStr('plugin_name'))) {
            $context->response->setError(_('Invalid plugin'), Sabai_URL::get());
            return;
        }
        $plugin_mngr->dispatch('Plugin', array(&$context->request), $plugin->get('name'));
    }
}